package pl.edu.agh.strategies;

import java.util.List;

public class WeekTrend extends AbstractStrategy {

	@Override
	public boolean decide(List<Integer> history) {
		int startUpTime = 30;
		if(history.size() < startUpTime)
			return (new Random()).decide(history);
		int yesterday = history.size()-1;
		int weekDelta = history.get(yesterday) - history.get(yesterday-1);
		int predicted = history.get(yesterday) + weekDelta;
		return rateAndSave(predicted);
	}

}
